﻿using System;
using System.Collections.Generic;
using Flexible.Implementions.Bases;
using Flexible.Implementions.Attributes;
using Flexible.Interfaces;

namespace Flexible.Samples
{
    public class HelloWorldPlugin : PluginBase
    {
        public override void Enable(IPluginActivateContext context)
        {
            for (int i = 0; i < TimesToSay; i++)
                Console.WriteLine("Hello, {0}!", Username);
        }

        public override void Disable(IPluginActivateContext context)
        {
            Console.WriteLine("Goodbye, {0}!", Username);
        }

        public override string Name
        {
            get { return "Hello world"; }
        }

        public override string Description
        {
            get { return "Sample plugin."; }
        }

        public override string Author
        {
            get { return "deerchao"; }
        }

        public override DateTime ReleaseTime
        {
            get { return new DateTime(2008, 4, 7); }
        }

        public override string Id
        {
            get { return "Flexible.Samples.HelloWorld"; }
        }

        public override Version Version
        {
            get { return new Version(1, 0, 0, 0); }
        }

        public override Version CompatibleVersion
        {
            get { return new Version(1, 0, 0, 0); }
        }

        [UserSetting("TimesToSay", null, "How many times of hello to say.", 1)]
        public int TimesToSay
        {
            get;
            set;
        }

        [UserSetting("Username", null, "Name of the current user.","User")]
        public string Username
        {
            get;
            set;
        }
    }
}
